﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Globalization;
using System.Threading;
using System.Windows.Threading;
using Informator.Presentation.Predmeti;
using Informator.Presentation.Adresar;
using Informator.Presentation.Common;

namespace Informator.Presentation.Virtuelni_viser
{
    /// <summary>
    /// Interaction logic for pgTreciSprat.xaml
    /// </summary>
    public partial class pgTreciSprat : Page
    {
        int vreme = 0;
        bool prv = true;
        bool clicked = true;
        DispatcherTimer timer = new DispatcherTimer();
        public pgTreciSprat()
        {
            InitializeComponent();
            this.Loaded += (oo, ee) => { Animate.SlideUp(this); };
            this.MouseLeftButtonDown += pgPrizemlje_MouseLeftButtonDown;
            timer.Interval = TimeSpan.FromMilliseconds(1);
            timer.Tick += timer_Tick;
            timer.Start();
        }

        private void pgPrizemlje_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (clicked != true)
            {
                Animate.SlideDown(Heder);
                Animate.SlideUp(Futer);
                prv = true;
                clicked = true;
            }
        }
        private void timer_Tick(object sender, EventArgs e)
        {
            vreme++;
            if ((vreme % 200) == 0 && prv == true)
            {
                Animate.SlideDownBack(Futer);
                Animate.SlideUpExit(Heder);
                prv = false;
                clicked = false;
                vreme = 0;
            }
        }

        private void btnGlavniMeni_Click(object sender, RoutedEventArgs e)
        {
            Animate.SlideDownExit(this);
        }

        private void btnPrizemlje_Click(object sender, RoutedEventArgs e)
        {
            pgPrizemlje pp = new pgPrizemlje();
            Animate.SlideDownPage(this, pp);
        }

        private void btnPrviSprat_Click(object sender, RoutedEventArgs e)
        {
            pgPrviSprat pps = new pgPrviSprat();
            Animate.SlideDownPage(this, pps);
        }

        private void btnDrugiSprat_Click(object sender, RoutedEventArgs e)
        {
            pgDrugiSprat pds = new pgDrugiSprat();
            Animate.SlideDownPage(this, pds);
        }

        private void btnCetvrtiSprat_Click(object sender, RoutedEventArgs e)
        {
            pgCetvrtiSprat pgc = new pgCetvrtiSprat();
            Animate.SlideDownPage(this, pgc);
        }
 
        private void btnPetiSprat_Click(object sender, RoutedEventArgs e)
        {
            pgPetiSprat pps = new pgPetiSprat();
            Animate.SlideDownPage(this, pps);
        }     
    }
}
